﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

using System.Web.Services;
using Newtonsoft.Json;

namespace PropertyAppraisal.DoemsKanCha
{
    public partial class DomeLou : System.Web.UI.Page
    {
        private static BLL.DictionaryBll Dictionarybll = new BLL.DictionaryBll();
        private static BLL.FloorsBll bll = new  BLL.FloorsBll ();
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        /// <summary>
        /// 反填详细信息
        /// </summary>
        /// <param name="pnum"></param>
        /// <returns></returns>
        [WebMethod]
        public static string BackData(string pnum)
        {
            var result = bll.GetListByPro(pnum);
            return JsonConvert.SerializeObject(result);
        }
        /// <summary>
        /// 添加
        /// </summary>
        /// <returns></returns>
        [WebMethod]
        public static int submins(string ProjectNumber, int Location_East, string Location_West, string Location_North, int Location_South, int Location_Position, int Location_Traffic, int Location_Convenient, int Location_Humanity, int Location_Quality, int Location_Community, int Location_Mature, int gongnuan, int Location_Facilities, string Location_Degree)
        {
            Model.EAFloors l = new Model.EAFloors();
            l.projectNumber = ProjectNumber;
            l.floor_Number = Location_East;
            l.floor_Landmark = Location_West;
            l.floor_Address = Location_North;
            l.floor_HouseStructure = Location_South;
            l.floor_BuildType = Location_Position;
            l.floor_Facade = Location_Traffic;
            l.floor_Public = Location_Convenient;
            l.floor_Lift = Location_Humanity;
            l.floor_LiftNum = Location_Quality;
            l.floor_Gas = Location_Community;
            l.floor_Water = Location_Mature;
            //供暖
            l.floor_Warm = gongnuan;
            l.floor_Door = Location_Facilities;
            l.floor_Explain = Location_Degree;
            l.floor_CreateTime = DateTime.Now;
            l.floor_CreatePeople = "小黑";

            BLL.FloorsBll bll = new BLL.FloorsBll();
            var result = bll.Add(l);
            if (result)
            {
                return 1;
            }
            else
                return 0;
        }

        /// <summary>
        /// 绑定房屋结构下拉框
        /// </summary>
        /// <returns></returns>
        public static string housjBD()
        {
            List<Model.SysDictionary> Dictionary = Dictionarybll.sb(18);
            var HtmlStr = "";
            for (var i = 0; i < Dictionary.Count; i++)
            {
                HtmlStr += "<option value=\"" + Dictionary[i].Dictionary_Number + "\">" + Dictionary[i].dictionary_Name + "</option>";
            }
            return HtmlStr;
        }
        /// <summary>
        /// 绑定建筑类型下拉框
        /// </summary>
        /// <returns></returns>
        public static string typeBD()
        {
            List<Model.SysDictionary> Dictionary = Dictionarybll.sb(19);
            var HtmlStr = "";
            for (var i = 0; i < Dictionary.Count; i++)
            {
                HtmlStr += "<option value=\"" + Dictionary[i].Dictionary_Number + "\">" + Dictionary[i].dictionary_Name + "</option>";
            }
            return HtmlStr;
        }
        /// <summary>
        /// 绑定外立面装饰下拉框
        /// </summary>
        /// <returns></returns>
        public static string wzBD()
        {
            List<Model.SysDictionary> Dictionary = Dictionarybll.sb(20);
            var HtmlStr = "";
            for (var i = 0; i < Dictionary.Count; i++)
            {
                HtmlStr += "<option value=\"" + Dictionary[i].Dictionary_Number + "\">" + Dictionary[i].dictionary_Name + "</option>";
            }
            return HtmlStr;
        }
        /// <summary>
        /// 绑定公共部位装饰下拉框
        /// </summary>
        /// <returns></returns>
        public static string gzBD()
        {
            List<Model.SysDictionary> Dictionary = Dictionarybll.sb(21);
            var HtmlStr = "";
            for (var i = 0; i < Dictionary.Count; i++)
            {
                HtmlStr += "<option value=\"" + Dictionary[i].Dictionary_Number + "\">" + Dictionary[i].dictionary_Name + "</option>";
            }
            return HtmlStr;
        }
        /// <summary>
        /// 绑定电梯下拉框
        /// </summary>
        /// <returns></returns>
        public static string dianBD()
        {
            List<Model.SysDictionary> Dictionary = Dictionarybll.sb(22);
            var HtmlStr = "";
            for (var i = 0; i < Dictionary.Count; i++)
            {
                HtmlStr += "<option value=\"" + Dictionary[i].Dictionary_Number + "\">" + Dictionary[i].dictionary_Name + "</option>";
            }
            return HtmlStr;
        }
        /// <summary>
        /// 绑定供气下拉框
        /// </summary>
        /// <returns></returns>
        public static string gqBD()
        {
            List<Model.SysDictionary> Dictionary = Dictionarybll.sb(23);
            var HtmlStr = "";
            for (var i = 0; i < Dictionary.Count; i++)
            {
                HtmlStr += "<option value=\"" + Dictionary[i].Dictionary_Number + "\">" + Dictionary[i].dictionary_Name + "</option>";
            }
            return HtmlStr;
        }
        /// <summary>
        /// 绑定供水下拉框
        /// </summary>
        /// <returns></returns>
        public static string gsBD()
        {
            List<Model.SysDictionary> Dictionary = Dictionarybll.sb(24);
            var HtmlStr = "";
            for (var i = 0; i < Dictionary.Count; i++)
            {
                HtmlStr += "<option value=\"" + Dictionary[i].Dictionary_Number + "\">" + Dictionary[i].dictionary_Name + "</option>";
            }
            return HtmlStr;
        }
        /// <summary>
        /// 绑定供暖下拉框
        /// </summary>
        /// <returns></returns>
        public static string gnBD()
        {
            List<Model.SysDictionary> Dictionary = Dictionarybll.sb(25);
            var HtmlStr = "";
            for (var i = 0; i < Dictionary.Count; i++)
            {
                HtmlStr += "<option value=\"" + Dictionary[i].Dictionary_Number + "\">" + Dictionary[i].dictionary_Name + "</option>";
            }
            return HtmlStr;
        }
        /// <summary>
        /// 绑定门禁系统下拉框
        /// </summary>
        /// <returns></returns>
        public static string doorBD()
        {
            List<Model.SysDictionary> Dictionary = Dictionarybll.sb(26);
            var HtmlStr = "";
            for (var i = 0; i < Dictionary.Count; i++)
            {
                HtmlStr += "<option value=\"" + Dictionary[i].Dictionary_Number + "\">" + Dictionary[i].dictionary_Name + "</option>";
            }
            return HtmlStr;
        }
    }
}